# 1.py
import sys


def getRes(arr, k):
    max_num = max(arr)
    new_arr = [max_num for _ in arr]
    diff = sum(new_arr) - sum(arr)
    res = 0
    if diff >= k:
        res = max_num
    else:
        diff = k - diff
        add_num = diff // len(arr)
        res = max_num + add_num + 1
    return res


if __name__ == "__main__":
    # 读取第一行的n
    # n,k
    line = sys.stdin.readline().strip()
    n, k = list(map(int, line.split()))
    # n numbers
    line = sys.stdin.readline().strip()
    arr = list(map(int, line.split()))

    res = getRes(arr, k)
    print(res)
